package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the DRUGSTORAGE_WITHDRAWEL database table.
 * 
 */
@Entity
@Table(name="DRUGSTORAGE_WITHDRAWEL")
@NamedQuery(name="DrugstorageWithdrawel.findAll", query="SELECT d FROM DrugstorageWithdrawel d")
public class DrugstorageWithdrawel implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="DRUGWITHDRAWEL_ID")
	private long drugwithdrawelId;

	@Column(name="ALLDRUGWITHDRAWEL_NAME")
	private String alldrugwithdrawelName;

	@Column(name="DRUGWITHDRAWEL_ALLCOST")
	private BigDecimal drugwithdrawelAllcost;

	@Temporal(TemporalType.DATE)
	@Column(name="DRUGWITHDRAWEL_DATE")
	private Date drugwithdrawelDate;

	//bi-directional many-to-one association to StorageWithdrawelDetail
	@OneToMany(mappedBy="drugstorageWithdrawel")
	private List<StorageWithdrawelDetail> storageWithdrawelDetails;

	public DrugstorageWithdrawel() {
	}

	public long getDrugwithdrawelId() {
		return this.drugwithdrawelId;
	}

	public void setDrugwithdrawelId(long drugwithdrawelId) {
		this.drugwithdrawelId = drugwithdrawelId;
	}

	public String getAlldrugwithdrawelName() {
		return this.alldrugwithdrawelName;
	}

	public void setAlldrugwithdrawelName(String alldrugwithdrawelName) {
		this.alldrugwithdrawelName = alldrugwithdrawelName;
	}

	public BigDecimal getDrugwithdrawelAllcost() {
		return this.drugwithdrawelAllcost;
	}

	public void setDrugwithdrawelAllcost(BigDecimal drugwithdrawelAllcost) {
		this.drugwithdrawelAllcost = drugwithdrawelAllcost;
	}

	public Date getDrugwithdrawelDate() {
		return this.drugwithdrawelDate;
	}

	public void setDrugwithdrawelDate(Date drugwithdrawelDate) {
		this.drugwithdrawelDate = drugwithdrawelDate;
	}

	public List<StorageWithdrawelDetail> getStorageWithdrawelDetails() {
		return this.storageWithdrawelDetails;
	}

	public void setStorageWithdrawelDetails(List<StorageWithdrawelDetail> storageWithdrawelDetails) {
		this.storageWithdrawelDetails = storageWithdrawelDetails;
	}

	public StorageWithdrawelDetail addStorageWithdrawelDetail(StorageWithdrawelDetail storageWithdrawelDetail) {
		getStorageWithdrawelDetails().add(storageWithdrawelDetail);
		storageWithdrawelDetail.setDrugstorageWithdrawel(this);

		return storageWithdrawelDetail;
	}

	public StorageWithdrawelDetail removeStorageWithdrawelDetail(StorageWithdrawelDetail storageWithdrawelDetail) {
		getStorageWithdrawelDetails().remove(storageWithdrawelDetail);
		storageWithdrawelDetail.setDrugstorageWithdrawel(null);

		return storageWithdrawelDetail;
	}

}